import { createApp, Plugin} from 'vue'
import App from './App.vue'
//Pinia
import { createPinia } from 'pinia'
//UI
import ElementPlus from 'element-plus'
import locale from 'element-plus/lib/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
//引入antd的日期组件
import {DatePicker as ADatePicker, RangePicker as ARangePicker, ConfigProvider as AConfigProvider} from 'ant-design-vue'
import 'ant-design-vue/es/date-picker/style/css'
//配置antd的日期组件中文
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn'
dayjs.locale('zh-cn')
//路由
import router from '@/router/index'
//SVG
import 'virtual:svg-icons-register'
//样式引入
import '@/theme/main.less'
import '@/theme/grid.less'
//Icon图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//全局指令
import { directives } from '@/util/directives'

const app = createApp(App)
app.use(router)
app.use(createPinia())
//Icon图标全部引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(ElementPlus, {locale})
app.use(AConfigProvider)
app.use(ADatePicker)
app.use(ARangePicker as unknown as Plugin)
directives(app)
app.mount('#app')